package com.parktech.sun.domain.repository.industryinfo.hibernate;

import com.parktech.sun.domain.model.industryinfo.IndustryInfo;
import com.parktech.sun.domain.model.industryinfo.IndustryInfoCategory;
import com.parktech.sun.domain.repository.hibernate.BaseRepositoryImpl;
import com.parktech.sun.domain.repository.industryinfo.IndustryInfoRepository;
import org.springframework.stereotype.Repository;

/**
 * User: Think
 * Date: 11-1-13
 * Time: 下午9:02
 */
@Repository
public class IndustryInfoRepositoryImpl extends BaseRepositoryImpl<IndustryInfo> implements IndustryInfoRepository {

    public void saveOrUpdateCategory(IndustryInfoCategory industryInfoCategory) {
        getSession().saveOrUpdate(industryInfoCategory);
    }

    public IndustryInfoCategory getByCategoryId(Long categoryId) {
        return (IndustryInfoCategory) getSession().get(IndustryInfoCategory.class, categoryId);
    }
}
